﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NPipeline.Event
{
    public enum StageState
    {
        INIT,
        PREPROCESS,
        PROCESS,
        POSTPROCESS,
        RELEASE
    }

    public delegate void StageErrorEventHandler(object source, StageErrorEventArgs e);

    public class StageErrorEventArgs : StageEventArgs
    {
        // the data is in the exception itself
        private StageException exception;
        private object data;
        private StageState state;

        public StageErrorEventArgs(IStage source, StageState state, object data, StageException ex)
            : base(source)
        {
            this.data = data;
            this.exception = ex;
            this.state = state;
        }

        public StageException RaisedException { get { return exception; } }
        public StageState State { get { return state; } }
        public object Data { get { return data; } }


    }
}
